<template>
	<view class="content">

		<image class="img_header" src="../../static/ic_login_logo.jpg"></image>

		<view class="u_name">{{nickname || '管理员'}}</view>

		<!-- <view class="menu_div" @click.stop="onRecord">
			<view class="menu_txt">安装列表</view>
			<image class="img_arrow" src="/static/ic_right_arrow.png"></image>
		</view>

		<view class="divider" /> -->

		<view class="menu_div" @click.stop="onApprove">
			<view class="menu_txt">安装列表(审核)</view>
			<image class="img_arrow" src="/static/ic_right_arrow.png"></image>
		</view>

		<view class="divider" />

		<view class="btn_ok" @click.stop="onOk">退出登录</view>

	</view>
</template>

<script>
	import { getUInfo } from '@/util/util.js'
	export default {
		data() {
			return {
				nickname: '',
			}
		},

		onLoad() {
			let that = this

			this.nickname = getUInfo().nickname
		},

		methods: {

			// 会员审核
			onApprove() {
				// this.$toast('会员审核')
				// this.$navigateTo('/pages/apply_list/apply_list')
				uni.switchTab({ url: '/pages/apply_list/apply_list' })
			},

			// 优惠券记录
			onRecord() {
				// this.$toast('优惠券记录')
				this.$navigateTo('/pages/reco_list/reco_list')
			},

			onOk() {
				// uni.showToast({ title: '退出登录', icon: 'none' })

				uni.showModal({
					title: '提示',
					content: '是否退出登录？',
					success: res => {
						if (res.confirm) {
							uni.removeStorageSync('admininfo')
							uni.redirectTo({ url: '/pages/login/login' })
						}
					}
				})

			}
		}
	}
</script>

<style scoped>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.img_header {
		width: 160rpx;
		height: 160rpx;
		margin: 100rpx 0 0 0;
		border-radius: 16rpx;
	}

	.u_name {
		font-size: 30rpx;
		margin: 20rpx 0 80rpx 0;
	}

	.btn_ok {
		background-color: deepskyblue;
		width: 75%;
		height: 66rpx;
		line-height: 66rpx;
		color: white;
		text-align: center;
		font-size: 30rpx;
		margin: 80rpx 0 0 0;
		border-radius: 888rpx;
	}

	.menu_div {
		display: flex;
		justify-content: space-between;
		align-items: center;
		width: 100%;
		height: 110rpx;
		margin: 0rpx 0 0 0;
	}

	.menu_txt {
		font-size: 28rpx;
		margin: 0 0 0 30rpx;
	}

	.img_arrow {
		width: 30rpx;
		height: 30rpx;
		margin: 0 30rpx 0 0;
	}

	.divider {
		width: calc(100% - 60rpx);
		height: 1rpx;
		background-color: rgba(1, 1, 1, 0.12);
		margin: 0 30rpx 0 30rpx;
	}
</style>